AC_INIT([xtuloginer], [1.0.4])

AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([config.h:config.h.in])

AC_CONFIG_AUX_DIR([build-aux])

AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror foreign])
AC_CHECK_LIB([iniparser], [iniparser_load], [], [
    echo "No iniparser found."
    exit -1
])
AC_CHECK_LIB([cjson], [cJSON_Version], [], [
    echo "No cJSON library found."
    exit -1
])
LIBCURL_CHECK_CONFIG([yes], [7.7.2], [], [
    echo "No libcurl found."
    exit -1
])
printf "checking whether libcurl supports HTTP... "
if eval test x"$libcurl_protocol_HTTP" != x"yes"; then
    echo "no"
    echo "libcurl not support HTTP."
    exit -1
fi
echo "yes"
LIBS="$LIBCURL $LIBS"
CFLAGS="$LIBCURL_CPPFLAGS $CFLAGS"

AC_CHECK_HEADERS([stdint.h], [], [
    echo "No stdint.h found."
    exit -1
])
AC_CHECK_TYPES([uint64_t], [], [], [#include <stdint.h>])
AC_CHECK_HEADERS([iniparser/iniparser.h], [], [
    echo "No iniparser headers found."
    exit -1
])
AC_CHECK_HEADERS([cjson/cJSON.h], [], [
    echo "No cJSON headers found."
    exit -1
])
AC_CHECK_HEADERS([regex.h], [], [
    echo "No POSIX regex.h found."
    exit -1
])

AC_CONFIG_FILES([Makefile])

AC_OUTPUT
